<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>图书借阅</title>
<link href="/public/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script src="/public/js/bootstrap.min.js"></script>
<script src="/public/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
	function getstubycard(event,stucard){
		if(event.keyCode==13){
			$('#stuinfo').html('');
			$('#bookinfo').html('');
			$.get("__URL__/getstuinfo",{stucard:stucard},
				function(data){
					$('#stuinfo').html(data);
					$('#stucard').val('');
					$('#isbn').show();
				}
			);
		}
	}
	
	function getbookbyisbn(event,bookisbn){
	  if(event.keyCode==13){
		  $.get("__URL__/getbookinfo",{bookisbn:bookisbn},
				function(data){
					$('#bookinfo').html(data);
					$('#bookisbn').val('');
				}
		  );
	  }
	}	
</script>
</head>

<body>
<div class="row-fluid">
  <h1 class="text-center">图书借阅</h1>
  <hr class="info">
</div>
<div class="row-fluid" id="card">
  <div class="span6 offset3">
      <legend> 请刷会员卡</legend>
      <input id="stucard" name="stucard" type="text" placeholder="输入会员卡号" onkeydown="getstubycard(event,this.value);" />
      <span class="help-block" id="stuinfo"></span>
  </div>
</div>

<div class="row-fluid" style="display:none" id="isbn">
<div class="span6 offset3">
      <legend>    请扫描书本条码</legend>
      <input id="bookisbn" name="bookisbn" type="text"  placeholder="输入书本背面条码编号" onkeydown="getbookbyisbn(event,this.value);" />
      <span class="help-block" id="bookinfo"></span>
  </div>
</div>


</body>
</html>